package megadict.draft.index;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import org.junit.Test;


public class LinkedHashSetLearning {

    @Test
    public void testDuplicateValueIntoLinkedHashSet() {
        
        String[] items = {
                "person", "zoom", "tester", "genzer"
        };
        
        Set<String> normalSet = new HashSet<String>(items.length);
        
        for (String item : items) {
            normalSet.add(item);
        }
        
        Set<String> history = new LinkedHashSet<String>(normalSet);
        
        
        System.out.println(history);
        
        if (history.contains("person")) {
            history.remove("person");
        }
        
        history.add("person");        
        System.out.println(history);
        
    }
    
}
